package com.xys.auth.bean;

import com.xys.auth.utils.DateTimeUtils;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Syslog {
    private String id;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date visitTime;

    private String visitTimeStr;

    private String username;

    private String ip;

    private String url;

    private long executionTime;

    private String method;

    public String getVisitTimeStr() {
        return DateTimeUtils.castToDateStr(visitTime,"yyyy-MM-dd HH:mm");
    }
}
